package com.designpattern.StrategyPattern.example1;

/**
 * @Author yp
 * @Date 2021-05-24
 * @Description
 **/

public class Test {
    public static void main(String[] args) {

        Context context1 = new Context(new OperationAdd());
        System.out.println("添加操作" + context1.executeStrategy(9, 3));

        Context context2 = new Context(new OperationMultiply());
        System.out.println("乘积操作" + context2.executeStrategy(9, 3));

        Context context3 = new Context(new OperationSubtract());
        System.out.println("减法操作" + context3.executeStrategy(9, 3));
    }
}
